import { axios } from '@/utils/request'

export function fetchList (params) {
  return axios({
    url: '/cmsMenus/page',
    method: 'GET',
    params: {
      ...params
    }
  })
}
export function getObj (id) {
  return axios({
    url: `/cmsMenus/${id}`,
    method: 'GET'
  })
}
export function save (params) {
  return axios({
    url: '/cmsMenus/save',
    method: 'POST',
    data: params
  })
}
export function update (params) {
  return axios({
    url: '/cmsMenus/update',
    method: 'PUT',
    data: params
  })
}
export function deleteObj (id) {
  return axios({
    url: `/cmsMenus/${id}`,
    method: 'DELETE'
  })
}
// 上级菜单
export function fetchTree () {
  return axios({
    url: '/cmsMenus/select',
    method: 'GET'
  })
}
// 查询所有
export function treeList () {
  return axios({
    url: '/cmsMenus/tree',
    method: 'GET'
  })
}
